package com.example.vote.springboot_vote;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
@Primary //解决required a single bean, but 2 were found:
public class VoteUserServiceMybatisImpl implements VoteUserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public int create(String name, Integer age) {

        return 0;
    }

    @Override
    public List<User> getByName(String name) {
        List<User> list = userMapper.findByName(name);
        return list;
    }

    @Override
    public int deleteByName(String name) {
        return 0;
    }

    @Override
    public int getAllUsers() {
        return 0;
    }

    @Override
    public int deleteAllUsers() {
        return 0;
    }
}
